#!/bin/bash

# python-mutagen is need for command mid3cp

DIR=$1
shift
if [ -z "$DIR" ] ;then
echo "must provide DIR"
exit 0
fi

[ ! -d "$DIR" ] && mkdir -pv "$DIR"

for file in "$@"; do
echo -n "Converting '$file' ... "
DEST="$DIR"/$(basename "$file")
mplayer --really-quiet -ao pcm "$file"
avconv -v quiet -i audiodump.wav "$DEST"
rm -f audiodump.wav
mid3cp "$file" "$DEST"
echo "Done!"
done
